projects
/
babl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e32a422
)
babl: make babl_model_with_space able to take format/model for space
author
Øyvind Kolås
<pippin@gimp.org>
Wed, 11 Jul 2018 21:23:08 +0000
(23:23 +0200)
committer
Øyvind Kolås
<pippin@gimp.org>
Wed, 11 Jul 2018 21:23:08 +0000
(23:23 +0200)
babl/babl-model.c
patch
|
blob
|
history
diff --git
a/babl/babl-model.c
b/babl/babl-model.c
index 2156059065345c49ca0f78286f40e2c068fd7261..d3471ed77afeb66789908e63c28d9182e27c1cf8 100644
(file)
--- a/
babl/babl-model.c
+++ b/
babl/babl-model.c
@@
-374,6
+374,20
@@
babl_remodel_with_space (const Babl *model, const Babl *space)
int i;
assert (BABL_IS_BABL (model));
+ if (!space) space = babl_space ("sRGB");
+ if (space->class_type == BABL_FORMAT)
+ {
+ space = space->format.space;
+ }
+ else if (space->class_type == BABL_MODEL)
+ {
+ space = space->model.space;
+ }
+ else if (space->class_type != BABL_SPACE)
+ {
+ return NULL;
+ }
+
if (model->model.space == space)
return (void*)model;